'use strict';

const Controller = require('egg').Controller;

class UpdataController extends Controller {
  async index() {
    const { ctx } = this;
    ctx.body = 'hi, eqgg';
    let ziduan=ctx.request.body

    let text = await this.ctx.service.escape.escape(ziduan.chapterText)

    let sql1 = `INSERT INTO chapter ( chapterName, chapterText,zhangjie,bookID) VALUES ( "${ziduan.chapterName}", "${text}", "${ziduan.zhangjie}", "${ziduan.bookID}")`
    let result = await this.app.mysql.query(sql1)
    // console.log(result,77);
  }

}

module.exports = UpdataController;